package org.samoji.sji.model;
import java.math.BigDecimal;
import java.math.MathContext;

import org.samoji.sji.profTokenizer.Token.Type;

public class TimesBinExpr extends BinExpr {
	public TimesBinExpr(Expr left, Expr right) {
		super(Type.Times, left, right);
	}

	@Override
	public BigDecimal evaluate(Env env) {
		return left.evaluate(env).multiply(right.evaluate(env), MathContext.DECIMAL128);
	}
	
	public static TimesBinExpr _(Expr left, Expr right) {
		return new TimesBinExpr(left, right);
	}
}